home *** CD-ROM | disk | FTP | other *** search
/ Champak Vol E-12 / (Vol E-12) May 21 2012.iso / Animations / dj / dj.swf / scripts / __Packages / mx / controls / streamingmedia / RTMPConnection.as < prev    next >
Text File  |  2012-05-21  |  1KB  |  40 lines

  1. class mx.controls.streamingmedia.RTMPConnection extends NetConnection
  2. {
  3.    static var _connectorQueue = new Array();
  4.    function RTMPConnection(player)
  5.    {
  6.       super();
  7.       this._player = player;
  8.    }
  9.    function onMetaData(info)
  10.    {
  11.       this._player.setTotalTime(info.duration);
  12.    }
  13.    function connect(targetURI, streamName)
  14.    {
  15.       if(mx.controls.streamingmedia.RTMPConnection._connectFlag == true)
  16.       {
  17.          this.pushConnection(targetURI,streamName);
  18.          return undefined;
  19.       }
  20.       mx.controls.streamingmedia.RTMPConnection._connectFlag = true;
  21.       super.connect(targetURI,streamName);
  22.       this.popConnection();
  23.    }
  24.    function pushConnection(targetURI, streamName)
  25.    {
  26.       this._targetURI = targetURI;
  27.       this._streamName = streamName;
  28.       mx.controls.streamingmedia.RTMPConnection._connectorQueue.push(this);
  29.    }
  30.    function popConnection()
  31.    {
  32.       mx.controls.streamingmedia.RTMPConnection._connectFlag = false;
  33.       if(mx.controls.streamingmedia.RTMPConnection._connectorQueue.length != 0)
  34.       {
  35.          var _loc1_ = mx.controls.streamingmedia.RTMPConnection._connectorQueue.pop();
  36.          _loc1_.connect(_loc1_._targetURI,_loc1_._streamName);
  37.       }
  38.    }
  39. }
  40.